from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
from google.appengine.api import users
from mako.template import Template
from mako.lookup import TemplateLookup

from models.project import MasterControlProject

class UserHomeHandler(webapp.RequestHandler):
    def get(self):
        user = users.get_current_user()
        projects = MasterControlProject.all().filter('owner =', user)
        temp = Template(filename = 'templates/user_home.html', lookup = TemplateLookup(directories=['.']))
        self.response.out.write(temp.render(user = user, projects = projects))